from django.contrib import admin
from .models import VirtualScene, MeditationCourse, MeditationRecord, WhiteNoise


@admin.register(VirtualScene)
class VirtualSceneAdmin(admin.ModelAdmin):
    """虚拟场景管理"""
    list_display = ['id', 'scene_name', 'scene_type', 'recommended_for', 'is_active', 'created_at']
    list_filter = ['scene_type', 'is_active', 'created_at']
    search_fields = ['scene_name', 'description']
    ordering = ['-created_at']


@admin.register(MeditationCourse)
class MeditationCourseAdmin(admin.ModelAdmin):
    """冥想课程管理"""
    list_display = ['id', 'course_name', 'category', 'duration_minutes', 'difficulty_level', 'is_active', 'created_at']
    list_filter = ['category', 'difficulty_level', 'is_active', 'created_at']
    search_fields = ['course_name', 'description']
    ordering = ['-created_at']


@admin.register(MeditationRecord)
class MeditationRecordAdmin(admin.ModelAdmin):
    """冥想记录管理"""
    list_display = ['id', 'user', 'course', 'scene', 'duration_minutes', 'focus_score', 'meditation_date']
    list_filter = ['meditation_date', 'focus_score']
    search_fields = ['user__username', 'course__course_name']
    date_hierarchy = 'meditation_date'
    ordering = ['-meditation_date']


@admin.register(WhiteNoise)
class WhiteNoiseAdmin(admin.ModelAdmin):
    """白噪音管理"""
    list_display = ['id', 'noise_name', 'noise_type', 'duration_minutes', 'is_active', 'created_at']
    list_filter = ['noise_type', 'is_active', 'created_at']
    search_fields = ['noise_name', 'description']
    ordering = ['-created_at']
